#include <iostream>
using namespace std;

int main()
{
	long long m, k;
	int count = 0;
	cin >> m >> k;
	while(m)
	{
		if(m % 10 == 3)
			++count;
		m /= 10;
	}
	if(count == k)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
}
